<div class="card ">
    <div class="card-body">
        <div class="card-head text-right">
            <button  class="btn btn-outline-info" (click)="addNews()">添加</button>
          </div>

  <table class="table table-striped table-dark table-bordered">
      <thead class="thead-dark">
    <tr>
      <th>排序</th>
      <th>主键</th>
      <th>标题</th>
      <th>作者</th>
      <th>发布时间</th>
      <th>内容</th>
      <th>封面</th>
      <th>操作</th>
    </tr>
    </thead>

    <tr *ngFor="let n of nl" >
      <td>{{n.px}}</td>
      <td>{{n.newid}}</td>
      <td>{{n.title}}</td>
      <td>{{n.author}}</td>
      <td>{{n.pbdate | date:"yyyy-MM-dd HH:mm"}}</td>
      <td>
        <img width="200px" height="200px" src="{{HOST}}{{n.coverpic}}" *ngIf="n.coverpic" />
        <input type="file" (change)="onFileChanged($event)">
      </td>
      <td>
        <div [innerHTML]="n.content| tohtml"></div>
      </td>
      <td>
        <button class="btn btn-outline-warning" (click)="editNews(n.newid)">修改</button>
        <button class="btn btn-outline-danger" (click)="deleteNews(n.newid)">删除</button>
        <button class="btn btn-outline-primary" (click)="toDetail(n.newid)">预览</button>
        <button class="btn btn-outline-success" (click)="uploadNewsCover(n.newid)">上传封面</button>
      </td>
    </tr>
  </table>

</div>

<div class="card-foot ">
    <nav aria-label="Page navigation example">
        <ul class="pagination justify-content-end">
          <li class="page-item"><a class="page-link" href="#">上一页</a></li>
          <li class="page-item"><a class="page-link" href="#">1</a></li>
          <li class="page-item"><a class="page-link" href="#">2</a></li>
          <li class="page-item"><a class="page-link" href="#">3</a></li>
          <li class="page-item"><a class="page-link" href="#">下一页</a></li>
        </ul>
      </nav>
  </div>
</div>

